package com.woniuxy.health.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.health.auth.entity.User;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface UserMapper extends BaseMapper<User> {
    @Select("select * from rbac_user where account=#{account}")
    @Results({
            @Result(id=true,column="id",property="id"),
            @Result(column="id",property="role",one=@One(select="com.woniuxy.health.auth.mapper.RoleMapper.findRoleById"))
    })
    User findRoleAndPerms(String account);
}